import Vue from 'vue'
import Router from 'vue-router'

// const About = () => import('./views/About.vue')
// const login =()=>import('./views/login.vue')
// const register=()=>import('./views/register.vue')
Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            redirect: '/index'
        },
        {
            path: '/login',
            name: 'login',
            component: () =>
                import ('./views/login.vue')
        },
        {
            path: '/register',
            name: 'register',
            component: () =>
                import ('./views/register.vue')
        },
        {
            path: '/cart',
            name: 'cart',
            component: () =>
                import ('./views/cart.vue')
        },

        {
            path: '/index',
            name: 'index',
            component: () =>
                import ('./views/index.vue'),
            redirect: '/lunbo',
            children: [{
                    path: '/home',
                    name: 'home',
                    component: () =>
                        import ('./views/home.vue'),
                    redirect: '/lunbo',
                    children: [{
                            path: '/lunbo',
                            name: 'lunbo',
                            component: () =>
                                import ('./views/lunbo.vue')
                        },
                        {
                            path: '/nvzhuang',
                            name: 'nvzhuang',
                            component: () =>
                                import ('./views/nvzhuang')
                        },
                        {
                            path: '/nanzhuang',
                            name: 'nanzhuang',
                            component: () =>
                                import ('./views/nanzhuang')
                        },

                    ]
                },
                {
                    path: '/baoyou',
                    name: 'baoyou',
                    component: () =>
                        import ('./views/baoyou')
                },
                {
                    path: '/fenlei',
                    name: 'fenlei',
                    component: () =>
                        import ('./views/fenlei.vue')
                },
                {
                    path: '/shoucang',
                    name: 'shoucang',
                    component: () =>
                        import ('./views/shoucang.vue')
                },
                {
                    path: '/Mymine',
                    name: 'Mymine',
                    component: () =>
                        import ('./views/Mymine')
                }
            ]

        },
        {
            path: '/setting',
            name: 'setting',
            component: () =>
                import ('./views/setting.vue')
        },
        {
            path: '/address',
            name: 'addrsss',
            component: () =>
                import ('./views/address.vue')
        },


    ]
})
